<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: Home.php 320 2008-11-23 07:18:37Z steen.rabol@gmail.com $
 *
 */

Prado::using('Application.Common.Data.PortalToDoRecord');
Prado::using('Application.Common.Data.PortalUserRecord');

class TestRead extends PortalAdminPage
{
	const CONFIG_FILE		= 'Application.Data.Manifest';
	public function onLoad($param)
	{
		$portletSetup	= array();
		parent::onLoad($param);
		$this->AdminPageTitle = 'Home';
		
		$doc			= new TXmlDocument('1.0','utf-8');
		if($doc->loadFromFile(Prado::getPathOfNamespace(self::CONFIG_FILE,'.xml')))
		{
			foreach($doc->Elements as $element)
			{
				if($element->TagName === 'Type')
				{
					foreach($element->Elements as $properties)
					{
						foreach($properties->Elements as $property)
						{
							//PortalUtil::Info("xxx");
							PortalUtil::Info($property->TagName);
							$portletSetup['info'][$property->TagName] = $property->Value;
						}
					}
				}
				else if($element->TagName == 'Files')
				{
					foreach($element->Elements as $properties)
					{
						//PortalUtil::Info($properties->getAttribute('Id'));
						foreach($properties->Elements as $property)
						{
							//PortalUtil::Info("xxx");
							PortalUtil::Info($property->TagName);
							$portletSetup['files'][$properties->getAttribute('Id')][] = $property->Value;
						}
					}
				}
			}
			
			PortalUtil::Info($portletSetup);
		}
		else
		{
			PortalUtil::Info("Error reading XML");
		}
	}

	private function createParameter($id,$value)
	{
		$element=new TXmlElement('parameter');
		$element->Attributes['id']=$id;
		$element->Attributes['value']=TPropertyValue::ensureString($value);
		return $element;
	}
}

?>